﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 游戏平台原型
{
    public delegate void NOPHandler();//定义委托类型
    public delegate void ChangePanelStateHandler(int id,string state);//定义委托类型
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        public loginwindow win_login;
        public regwindow win_reg;
        public selectroomwindow win_selectroom;
        public roomwindow win_room;
        private void Form1_Load(object sender, EventArgs e)
        {
            win_login = new loginwindow(new NOPHandler(showreg), new NOPHandler(showselectroom));
            win_reg = new regwindow(new NOPHandler(showlogin));
            win_selectroom = new selectroomwindow(new NOPHandler(showroom));
            win_room = new roomwindow();
            win_login.Dock= System.Windows.Forms.DockStyle.Fill;
            win_reg.Dock = System.Windows.Forms.DockStyle.Fill;
            win_selectroom.Dock = System.Windows.Forms.DockStyle.Fill;
            win_room.Dock = System.Windows.Forms.DockStyle.Fill;
            showlogin();
        }
        private void showlogin()
        {
            win_login.Show();
            mainwindow.Controls.Clear();
            mainwindow.Controls.Add(win_login);
        }
        private void showreg()
        {
            win_reg.Show();
            mainwindow.Controls.Clear();
            mainwindow.Controls.Add(win_reg);
        }
        private void showselectroom()
        {
            win_selectroom.Show();
            mainwindow.Controls.Clear();
            mainwindow.Controls.Add(win_selectroom);
        }
        private void showroom()
        {
            win_room.Show();
            mainwindow.Controls.Clear();
            mainwindow.Controls.Add(win_room);
        }
    }
}
